﻿#define _CRT_SECURE_NO_WARNINGS

#include<iostream>

using namespace std;

class Date
{
public:
	//成员函数
	void print()
	{
		cout << _year <<" "<< _month << " " << _day << endl;
	}

	void Init(int year, int month, int day)
	{
		_year = year;
		_month = month;
		_day = day;
	}
private:
	//成员变量（这里只是声明变量，没有定义）
	int _day;
	int _month;
	int _year;
};

//分别把public和private都注释掉，看看程序能否编过

int main()
{
	Date a;
	a.Init(2004, 8, 22);
	a.print();
	a._day = 10;
	a.print();
	return 0;
}

